package com.hzk.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @auoter:jackh
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RespBean {//提供对象
    private long code;
    private Object message;
    private Long totalCount;
    private Object obj;

    public RespBean(Long i, Object message,Long totalCount) {
    }

    /*返回成功结果*/
    public static RespBean success(){
        return new RespBean(RespBeanEnum.SUCCESS.getCode(),RespBeanEnum.SUCCESS.getMessage(),0L,null);
    }
    public static RespBean success(Object obj){
        return new RespBean(RespBeanEnum.SUCCESS.getCode(),RespBeanEnum.SUCCESS.getMessage(),0L,obj);

    }

    /*返回失败结果*/
    public static RespBean error(RespBeanEnum respBeanEnum){
        return new RespBean(respBeanEnum.getCode(),respBeanEnum.getMessage(),0L,null);

    }
    public static RespBean error(RespBeanEnum respBeanEnum,Object obj){
        return new RespBean(respBeanEnum.getCode(),respBeanEnum.getMessage(),0L,obj);
    }

}
